#pragma once

#include "common.h"

#include "TSingleton.h"
#include "IInitalizable.h"

#include "D3DRender.h"
#include "D2DRender.h"
#include "RenderUtils.h"
#include "Timer.h"

class RenderMgr : public TSingleton<RenderMgr>, public IInitalizable
{
	friend TSingleton<RenderMgr>;

public:
	void Init();
	void Shutdown();
	bool IsInitialized();

	IDXGIFactory * const GetIDGXFactroryPtr();

	D3DRender * const GetD3DRenderPtr();
	D2DRender * const GetD2DRenderPtr();


	void Update(const Timer& timer);
	void Draw();

	void OnResize();
protected:

private:
	/*--------*/
	RenderMgr(void) {};
	RenderMgr(const RenderMgr& v) {};
	~RenderMgr(void) {};
	/*--------*/

	bool initalized;

	IDXGIFactory * dxgiFactory;
	IDXGISwapChain * swapChain;
	IDXGIDevice * dxgiDevice;

	D3DRender * d3dRender;
	D2DRender * d2dRender;
};

inline D3DRender * const RenderMgr::GetD3DRenderPtr()
{
	return d3dRender;
}

inline D2DRender * const RenderMgr::GetD2DRenderPtr()
{
	return d2dRender;
}